<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.8.13"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<title>EOS.IO: contracts/eoslib/generic_currency.hpp Source File</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/searchdata.js"></script>
<script type="text/javascript" src="search/search.js"></script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr style="height: 56px;">
  <td id="projectlogo"><img alt="Logo" src="eos-logo.png"/></td>
  <td id="projectalign" style="padding-left: 0.5em;">
   <div id="projectname">EOS.IO
   &#160;<span id="projectnumber">DAWN3.0.1</span>
   </div>
  </td>
 </tr>
 </tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.8.13 -->
<script type="text/javascript">
var searchBox = new SearchBox("searchBox", "search",false,'Search');
</script>
<script type="text/javascript" src="menudata.js"></script>
<script type="text/javascript" src="menu.js"></script>
<script type="text/javascript">
$(function() {
  initMenu('',true,false,'search.php','Search');
  $(document).ready(function() { init_search(); });
});
</script>
<div id="main-nav"></div>
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
     onmouseover="return searchBox.OnSearchSelectShow()"
     onmouseout="return searchBox.OnSearchSelectHide()"
     onkeydown="return searchBox.OnSearchSelectKey(event)">
</div>

<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="javascript:void(0)" frameborder="0" 
        name="MSearchResults" id="MSearchResults">
</iframe>
</div>

<div id="nav-path" class="navpath">
  <ul>
<li class="navelem"><a class="el" href="dir_ae9b15dd87e066e1908bbd90e8f38627.html">contracts</a></li><li class="navelem"><a class="el" href="dir_3fea0bf1ce879ce73e6ecec98007efcd.html">eoslib</a></li>  </ul>
</div>
</div><!-- top -->
<div class="header">
  <div class="headertitle">
<div class="title">generic_currency.hpp</div>  </div>
</div><!--header-->
<div class="contents">
<a href="generic__currency_8hpp.html">Go to the documentation of this file.</a><div class="fragment"><div class="line"><a name="l00001"></a><span class="lineno">    1</span>&#160;<span class="preprocessor">#pragma once</span></div><div class="line"><a name="l00002"></a><span class="lineno">    2</span>&#160;<span class="preprocessor">#include &lt;<a class="code" href="singleton_8hpp.html">eoslib/singleton.hpp</a>&gt;</span></div><div class="line"><a name="l00003"></a><span class="lineno">    3</span>&#160;<span class="preprocessor">#include &lt;<a class="code" href="table_8hpp.html">eoslib/table.hpp</a>&gt;</span></div><div class="line"><a name="l00004"></a><span class="lineno">    4</span>&#160;<span class="preprocessor">#include &lt;<a class="code" href="token_8hpp.html">eoslib/token.hpp</a>&gt;</span></div><div class="line"><a name="l00005"></a><span class="lineno">    5</span>&#160;<span class="preprocessor">#include &lt;<a class="code" href="asset_8hpp.html">eoslib/asset.hpp</a>&gt;</span></div><div class="line"><a name="l00006"></a><span class="lineno">    6</span>&#160;<span class="preprocessor">#include &lt;<a class="code" href="dispatcher_8hpp.html">eoslib/dispatcher.hpp</a>&gt;</span></div><div class="line"><a name="l00007"></a><span class="lineno">    7</span>&#160;</div><div class="line"><a name="l00008"></a><span class="lineno">    8</span>&#160;<span class="keyword">namespace </span><a class="code" href="namespaceeosio.html">eosio</a> {</div><div class="line"><a name="l00009"></a><span class="lineno">    9</span>&#160;</div><div class="line"><a name="l00010"></a><span class="lineno">   10</span>&#160;   <span class="keyword">template</span>&lt;<span class="keyword">typename</span> Token&gt;</div><div class="line"><a name="l00011"></a><span class="lineno"><a class="line" href="classeosio_1_1generic__currency.html">   11</a></span>&#160;   <span class="keyword">class </span><a class="code" href="classeosio_1_1generic__currency.html">generic_currency</a> {</div><div class="line"><a name="l00012"></a><span class="lineno">   12</span>&#160;      <span class="keyword">public</span>:</div><div class="line"><a name="l00013"></a><span class="lineno"><a class="line" href="classeosio_1_1generic__currency.html#a10520caf18cda7f18adb03ccf7357db9">   13</a></span>&#160;          <span class="keyword">typedef</span> Token <a class="code" href="classeosio_1_1generic__currency.html#a10520caf18cda7f18adb03ccf7357db9">token_type</a>;</div><div class="line"><a name="l00014"></a><span class="lineno"><a class="line" href="classeosio_1_1generic__currency.html#ad8da6c376cee10ea81135e399ffa031e">   14</a></span>&#160;          <span class="keyword">static</span> <span class="keyword">const</span> <a class="code" href="group__types.html#gaaa5d1cd013383c889537491c3cfd9aad">uint64_t</a> <a class="code" href="classeosio_1_1generic__currency.html#ad8da6c376cee10ea81135e399ffa031e">code</a>                = token_type::code;</div><div class="line"><a name="l00015"></a><span class="lineno"><a class="line" href="classeosio_1_1generic__currency.html#af08bb98a1c7d7946844b716a4da6e951">   15</a></span>&#160;          <span class="keyword">static</span> <span class="keyword">const</span> <a class="code" href="group__types.html#gaaa5d1cd013383c889537491c3cfd9aad">uint64_t</a> <a class="code" href="classeosio_1_1generic__currency.html#af08bb98a1c7d7946844b716a4da6e951">symbol</a>              = token_type::symbol;</div><div class="line"><a name="l00016"></a><span class="lineno"><a class="line" href="classeosio_1_1generic__currency.html#ab2ef05598c7040a8302471ecfdf4c495">   16</a></span>&#160;          <span class="keyword">static</span> <span class="keyword">const</span> <a class="code" href="group__types.html#gaaa5d1cd013383c889537491c3cfd9aad">uint64_t</a> <a class="code" href="classeosio_1_1generic__currency.html#ab2ef05598c7040a8302471ecfdf4c495">accounts_table_name</a> = <a class="code" href="group__types.html#gaf9c1edb0e0da55ec6ba09f32f6839529">N</a>(<a class="code" href="structeosio_1_1generic__currency_1_1account.html">account</a>);</div><div class="line"><a name="l00017"></a><span class="lineno"><a class="line" href="classeosio_1_1generic__currency.html#af9ff021f61805a1eec118685013c6952">   17</a></span>&#160;          <span class="keyword">static</span> <span class="keyword">const</span> <a class="code" href="group__types.html#gaaa5d1cd013383c889537491c3cfd9aad">uint64_t</a> <a class="code" href="classeosio_1_1generic__currency.html#af9ff021f61805a1eec118685013c6952">stats_table_name</a>    = <a class="code" href="group__types.html#gaf9c1edb0e0da55ec6ba09f32f6839529">N</a>(stat);</div><div class="line"><a name="l00018"></a><span class="lineno">   18</span>&#160;</div><div class="line"><a name="l00019"></a><span class="lineno"><a class="line" href="structeosio_1_1generic__currency_1_1issue.html">   19</a></span>&#160;          <span class="keyword">struct </span><a class="code" href="structeosio_1_1generic__currency_1_1issue.html">issue</a> : <a class="code" href="structeosio_1_1action__meta.html">action_meta</a>&lt;code,N(issue)&gt; {</div><div class="line"><a name="l00020"></a><span class="lineno"><a class="line" href="structeosio_1_1generic__currency_1_1issue.html#ae02349b4ae5d6ef313d0155b264458d7">   20</a></span>&#160;             <span class="keyword">typedef</span> <a class="code" href="structeosio_1_1action__meta.html">action_meta&lt;code,N(issue)&gt;</a> <a class="code" href="structeosio_1_1generic__currency_1_1issue.html#ae02349b4ae5d6ef313d0155b264458d7">meta</a>;</div><div class="line"><a name="l00021"></a><span class="lineno"><a class="line" href="structeosio_1_1generic__currency_1_1issue.html#ad7a382e1cf0662bec97b221280afbff4">   21</a></span>&#160;             <a class="code" href="group__types.html#ga3b44deb4b3b8d6ebab339d1263692117">account_name</a> <a class="code" href="structeosio_1_1generic__currency_1_1issue.html#ad7a382e1cf0662bec97b221280afbff4">to</a>;</div><div class="line"><a name="l00022"></a><span class="lineno"><a class="line" href="structeosio_1_1generic__currency_1_1issue.html#ab63969c82900ca3cab6909262f83828e">   22</a></span>&#160;             <a class="code" href="structeosio_1_1asset.html">asset</a>        <a class="code" href="structeosio_1_1generic__currency_1_1issue.html#ab63969c82900ca3cab6909262f83828e">quantity</a>;</div><div class="line"><a name="l00023"></a><span class="lineno">   23</span>&#160;</div><div class="line"><a name="l00024"></a><span class="lineno">   24</span>&#160;             <span class="keyword">template</span>&lt;<span class="keyword">typename</span> DataStream&gt;</div><div class="line"><a name="l00025"></a><span class="lineno"><a class="line" href="structeosio_1_1generic__currency_1_1issue.html#a20dfa160951f3fa52bf2cd934ab13f90">   25</a></span>&#160;             <span class="keyword">friend</span> DataStream&amp; <a class="code" href="structeosio_1_1generic__currency_1_1issue.html#a20dfa160951f3fa52bf2cd934ab13f90">operator &lt;&lt; </a>( DataStream&amp; ds, <span class="keyword">const</span> <a class="code" href="structeosio_1_1generic__currency_1_1issue.html">issue</a>&amp; t ){</div><div class="line"><a name="l00026"></a><span class="lineno">   26</span>&#160;                <span class="keywordflow">return</span> ds &lt;&lt; t.<a class="code" href="structeosio_1_1generic__currency_1_1issue.html#ad7a382e1cf0662bec97b221280afbff4">to</a> &lt;&lt; t.<a class="code" href="structeosio_1_1generic__currency_1_1issue.html#ab63969c82900ca3cab6909262f83828e">quantity</a>;</div><div class="line"><a name="l00027"></a><span class="lineno">   27</span>&#160;             }</div><div class="line"><a name="l00028"></a><span class="lineno">   28</span>&#160;             <span class="keyword">template</span>&lt;<span class="keyword">typename</span> DataStream&gt;</div><div class="line"><a name="l00029"></a><span class="lineno"><a class="line" href="structeosio_1_1generic__currency_1_1issue.html#a120e7e039c586b4fad05c295a3c796c8">   29</a></span>&#160;             <span class="keyword">friend</span> DataStream&amp; <a class="code" href="structeosio_1_1generic__currency_1_1issue.html#a120e7e039c586b4fad05c295a3c796c8">operator &gt;&gt; </a>( DataStream&amp; ds, <a class="code" href="structeosio_1_1generic__currency_1_1issue.html">issue</a>&amp; t ){</div><div class="line"><a name="l00030"></a><span class="lineno">   30</span>&#160;                <span class="keywordflow">return</span> ds &gt;&gt; t.<a class="code" href="structeosio_1_1generic__currency_1_1issue.html#ad7a382e1cf0662bec97b221280afbff4">to</a> &gt;&gt; t.<a class="code" href="structeosio_1_1generic__currency_1_1issue.html#ab63969c82900ca3cab6909262f83828e">quantity</a>;</div><div class="line"><a name="l00031"></a><span class="lineno">   31</span>&#160;             }</div><div class="line"><a name="l00032"></a><span class="lineno">   32</span>&#160;          };</div><div class="line"><a name="l00033"></a><span class="lineno">   33</span>&#160;</div><div class="line"><a name="l00034"></a><span class="lineno"><a class="line" href="structeosio_1_1generic__currency_1_1transfer.html">   34</a></span>&#160;          <span class="keyword">struct </span><a class="code" href="structeosio_1_1generic__currency_1_1transfer.html">transfer</a> : <a class="code" href="structeosio_1_1action__meta.html">action_meta</a>&lt;code,N(transfer)&gt; {</div><div class="line"><a name="l00035"></a><span class="lineno"><a class="line" href="structeosio_1_1generic__currency_1_1transfer.html#a51e7f73fde4d8fbceda2374531017284">   35</a></span>&#160;             <a class="code" href="structeosio_1_1generic__currency_1_1transfer.html#a51e7f73fde4d8fbceda2374531017284">transfer</a>(){}</div><div class="line"><a name="l00036"></a><span class="lineno"><a class="line" href="structeosio_1_1generic__currency_1_1transfer.html#ac093aeedb8df49abe7f5f5929a101636">   36</a></span>&#160;             <a class="code" href="structeosio_1_1generic__currency_1_1transfer.html#ac093aeedb8df49abe7f5f5929a101636">transfer</a>( <a class="code" href="group__types.html#ga3b44deb4b3b8d6ebab339d1263692117">account_name</a> f, <a class="code" href="group__types.html#ga3b44deb4b3b8d6ebab339d1263692117">account_name</a> t, token_type q ):from(f),<a class="code" href="structeosio_1_1generic__currency_1_1issue.html#ad7a382e1cf0662bec97b221280afbff4">to</a>(t),<a class="code" href="structeosio_1_1generic__currency_1_1issue.html#ab63969c82900ca3cab6909262f83828e">quantity</a>(q){}</div><div class="line"><a name="l00037"></a><span class="lineno">   37</span>&#160;</div><div class="line"><a name="l00038"></a><span class="lineno"><a class="line" href="structeosio_1_1generic__currency_1_1transfer.html#abf091a9eedd3b678e95d0425bf765126">   38</a></span>&#160;             <a class="code" href="group__types.html#ga3b44deb4b3b8d6ebab339d1263692117">account_name</a> <a class="code" href="structeosio_1_1generic__currency_1_1transfer.html#abf091a9eedd3b678e95d0425bf765126">from</a>;</div><div class="line"><a name="l00039"></a><span class="lineno"><a class="line" href="structeosio_1_1generic__currency_1_1transfer.html#a0c9d02a236a387f2cf1e1385f2f1ba11">   39</a></span>&#160;             <a class="code" href="group__types.html#ga3b44deb4b3b8d6ebab339d1263692117">account_name</a> <a class="code" href="structeosio_1_1generic__currency_1_1transfer.html#a0c9d02a236a387f2cf1e1385f2f1ba11">to</a>;</div><div class="line"><a name="l00040"></a><span class="lineno"><a class="line" href="structeosio_1_1generic__currency_1_1transfer.html#a3cfaf544c7e318e4a9d6bf1a5c18d44c">   40</a></span>&#160;             <a class="code" href="structeosio_1_1asset.html">asset</a>        <a class="code" href="structeosio_1_1generic__currency_1_1transfer.html#a3cfaf544c7e318e4a9d6bf1a5c18d44c">quantity</a>;</div><div class="line"><a name="l00041"></a><span class="lineno">   41</span>&#160;</div><div class="line"><a name="l00042"></a><span class="lineno">   42</span>&#160;             <span class="comment">//EOSLIB_SERIALIZE( transfer, (from)(to)(quantity)(symbol) )</span></div><div class="line"><a name="l00043"></a><span class="lineno">   43</span>&#160;</div><div class="line"><a name="l00044"></a><span class="lineno">   44</span>&#160;             <span class="keyword">template</span>&lt;<span class="keyword">typename</span> DataStream&gt;</div><div class="line"><a name="l00045"></a><span class="lineno"><a class="line" href="structeosio_1_1generic__currency_1_1transfer.html#aadac42091a1b9322cfef489201d9e355">   45</a></span>&#160;             <span class="keyword">friend</span> DataStream&amp; <a class="code" href="structeosio_1_1generic__currency_1_1issue.html#a20dfa160951f3fa52bf2cd934ab13f90">operator &lt;&lt; </a>( DataStream&amp; ds, <span class="keyword">const</span> <a class="code" href="structeosio_1_1generic__currency_1_1transfer.html">transfer</a>&amp; t ){</div><div class="line"><a name="l00046"></a><span class="lineno">   46</span>&#160;                <span class="keywordflow">return</span> ds &lt;&lt; t.<a class="code" href="structeosio_1_1generic__currency_1_1transfer.html#abf091a9eedd3b678e95d0425bf765126">from</a> &lt;&lt; t.<a class="code" href="structeosio_1_1generic__currency_1_1transfer.html#a0c9d02a236a387f2cf1e1385f2f1ba11">to</a> &lt;&lt; t.<a class="code" href="structeosio_1_1generic__currency_1_1transfer.html#a3cfaf544c7e318e4a9d6bf1a5c18d44c">quantity</a>;</div><div class="line"><a name="l00047"></a><span class="lineno">   47</span>&#160;             }</div><div class="line"><a name="l00048"></a><span class="lineno">   48</span>&#160;             <span class="keyword">template</span>&lt;<span class="keyword">typename</span> DataStream&gt;</div><div class="line"><a name="l00049"></a><span class="lineno"><a class="line" href="structeosio_1_1generic__currency_1_1transfer.html#a32034f53b76adb3292cb4c5a9c08ab38">   49</a></span>&#160;             <span class="keyword">friend</span> DataStream&amp; <a class="code" href="structeosio_1_1generic__currency_1_1issue.html#a120e7e039c586b4fad05c295a3c796c8">operator &gt;&gt; </a>( DataStream&amp; ds, <a class="code" href="structeosio_1_1generic__currency_1_1transfer.html">transfer</a>&amp; t ){</div><div class="line"><a name="l00050"></a><span class="lineno">   50</span>&#160;                ds &gt;&gt; t.<a class="code" href="structeosio_1_1generic__currency_1_1transfer.html#abf091a9eedd3b678e95d0425bf765126">from</a> &gt;&gt; t.<a class="code" href="structeosio_1_1generic__currency_1_1transfer.html#a0c9d02a236a387f2cf1e1385f2f1ba11">to</a> &gt;&gt; t.<a class="code" href="structeosio_1_1generic__currency_1_1transfer.html#a3cfaf544c7e318e4a9d6bf1a5c18d44c">quantity</a>;</div><div class="line"><a name="l00051"></a><span class="lineno">   51</span>&#160;                <a class="code" href="group__systemcapi.html#gae2a6ebaf48fe7c69f847ae18f109d09a">assert</a>( t.<a class="code" href="structeosio_1_1generic__currency_1_1transfer.html#a3cfaf544c7e318e4a9d6bf1a5c18d44c">quantity</a>.<a class="code" href="structeosio_1_1asset.html#af2958993908e4647d9101b84a0689ae3">symbol</a>== token_type::symbol, <span class="stringliteral">&quot;unexpected asset type&quot;</span> );</div><div class="line"><a name="l00052"></a><span class="lineno">   52</span>&#160;                <span class="keywordflow">return</span> ds;</div><div class="line"><a name="l00053"></a><span class="lineno">   53</span>&#160;             }</div><div class="line"><a name="l00054"></a><span class="lineno">   54</span>&#160;          };</div><div class="line"><a name="l00055"></a><span class="lineno">   55</span>&#160;</div><div class="line"><a name="l00056"></a><span class="lineno"><a class="line" href="structeosio_1_1generic__currency_1_1transfer__memo.html">   56</a></span>&#160;          <span class="keyword">struct </span><a class="code" href="structeosio_1_1generic__currency_1_1transfer__memo.html">transfer_memo</a> : <span class="keyword">public</span> <a class="code" href="structeosio_1_1generic__currency_1_1transfer.html">transfer</a> {</div><div class="line"><a name="l00057"></a><span class="lineno"><a class="line" href="structeosio_1_1generic__currency_1_1transfer__memo.html#af3cea2050d53d3955d4d50e4e3750331">   57</a></span>&#160;             <a class="code" href="structeosio_1_1generic__currency_1_1transfer__memo.html#af3cea2050d53d3955d4d50e4e3750331">transfer_memo</a>(){}</div><div class="line"><a name="l00058"></a><span class="lineno"><a class="line" href="structeosio_1_1generic__currency_1_1transfer__memo.html#acac5d0a48da7db7b040025b86625d1f8">   58</a></span>&#160;             <a class="code" href="structeosio_1_1generic__currency_1_1transfer__memo.html#acac5d0a48da7db7b040025b86625d1f8">transfer_memo</a>( <a class="code" href="group__types.html#ga3b44deb4b3b8d6ebab339d1263692117">account_name</a> f, <a class="code" href="group__types.html#ga3b44deb4b3b8d6ebab339d1263692117">account_name</a> t, token_type q, <span class="keywordtype">string</span> m )</div><div class="line"><a name="l00059"></a><span class="lineno">   59</span>&#160;             :<a class="code" href="structeosio_1_1generic__currency_1_1transfer.html">transfer</a>( f, t, q ), memo( <a class="code" href="namespaceeosio.html#af29f4c3b46ef396883a8ba57c534a808">move</a>(m) ){}</div><div class="line"><a name="l00060"></a><span class="lineno">   60</span>&#160;</div><div class="line"><a name="l00061"></a><span class="lineno"><a class="line" href="structeosio_1_1generic__currency_1_1transfer__memo.html#a59639874f17b0aca9bf5451e659839f9">   61</a></span>&#160;             <span class="keywordtype">string</span>       <a class="code" href="structeosio_1_1generic__currency_1_1transfer__memo.html#a59639874f17b0aca9bf5451e659839f9">memo</a>;</div><div class="line"><a name="l00062"></a><span class="lineno">   62</span>&#160;</div><div class="line"><a name="l00063"></a><span class="lineno">   63</span>&#160;             <span class="keyword">template</span>&lt;<span class="keyword">typename</span> DataStream&gt;</div><div class="line"><a name="l00064"></a><span class="lineno"><a class="line" href="structeosio_1_1generic__currency_1_1transfer__memo.html#a774884f76a0cae5068b852843edcb986">   64</a></span>&#160;             <span class="keyword">friend</span> DataStream&amp; <a class="code" href="structeosio_1_1generic__currency_1_1issue.html#a20dfa160951f3fa52bf2cd934ab13f90">operator &lt;&lt; </a>( DataStream&amp; ds, <span class="keyword">const</span> <a class="code" href="structeosio_1_1generic__currency_1_1transfer__memo.html">transfer_memo</a>&amp; t ){</div><div class="line"><a name="l00065"></a><span class="lineno">   65</span>&#160;                ds &lt;&lt; static_cast&lt;const transfer&amp;&gt;(t);</div><div class="line"><a name="l00066"></a><span class="lineno">   66</span>&#160;                <span class="keywordflow">return</span> ds &lt;&lt; t.<a class="code" href="structeosio_1_1generic__currency_1_1transfer__memo.html#a59639874f17b0aca9bf5451e659839f9">memo</a>;</div><div class="line"><a name="l00067"></a><span class="lineno">   67</span>&#160;             }</div><div class="line"><a name="l00068"></a><span class="lineno">   68</span>&#160;             <span class="keyword">template</span>&lt;<span class="keyword">typename</span> DataStream&gt;</div><div class="line"><a name="l00069"></a><span class="lineno"><a class="line" href="structeosio_1_1generic__currency_1_1transfer__memo.html#a790e4ece5f85364654b75a7d1a3162ef">   69</a></span>&#160;             <span class="keyword">friend</span> DataStream&amp; <a class="code" href="structeosio_1_1generic__currency_1_1issue.html#a120e7e039c586b4fad05c295a3c796c8">operator &gt;&gt; </a>( DataStream&amp; ds, <a class="code" href="structeosio_1_1generic__currency_1_1transfer__memo.html">transfer_memo</a>&amp; t ){</div><div class="line"><a name="l00070"></a><span class="lineno">   70</span>&#160;                ds &gt;&gt; <span class="keyword">static_cast&lt;</span><a class="code" href="structeosio_1_1generic__currency_1_1transfer.html">transfer</a>&amp;<span class="keyword">&gt;</span>(t);</div><div class="line"><a name="l00071"></a><span class="lineno">   71</span>&#160;                <span class="keywordflow">return</span> ds &gt;&gt; t.<a class="code" href="structeosio_1_1generic__currency_1_1transfer__memo.html#a59639874f17b0aca9bf5451e659839f9">memo</a>;</div><div class="line"><a name="l00072"></a><span class="lineno">   72</span>&#160;             }</div><div class="line"><a name="l00073"></a><span class="lineno">   73</span>&#160;          };</div><div class="line"><a name="l00074"></a><span class="lineno">   74</span>&#160;</div><div class="line"><a name="l00075"></a><span class="lineno"><a class="line" href="structeosio_1_1generic__currency_1_1account.html">   75</a></span>&#160;          <span class="keyword">struct </span><a class="code" href="structeosio_1_1generic__currency_1_1account.html">account</a> {</div><div class="line"><a name="l00076"></a><span class="lineno"><a class="line" href="structeosio_1_1generic__currency_1_1account.html#a89518368bbfea762aa94dc2ec394c0a6">   76</a></span>&#160;             <a class="code" href="group__types.html#gaaa5d1cd013383c889537491c3cfd9aad">uint64_t</a>   symbol = token_type::symbol;</div><div class="line"><a name="l00077"></a><span class="lineno"><a class="line" href="structeosio_1_1generic__currency_1_1account.html#a13c6e346ffae80264736c53efdfce0ee">   77</a></span>&#160;             token_type <a class="code" href="structeosio_1_1generic__currency_1_1account.html#a13c6e346ffae80264736c53efdfce0ee">balance</a>;</div><div class="line"><a name="l00078"></a><span class="lineno">   78</span>&#160;</div><div class="line"><a name="l00079"></a><span class="lineno">   79</span>&#160;             <span class="keyword">template</span>&lt;<span class="keyword">typename</span> DataStream&gt;</div><div class="line"><a name="l00080"></a><span class="lineno"><a class="line" href="structeosio_1_1generic__currency_1_1account.html#a020c928b711ed83e22daf25216ed571d">   80</a></span>&#160;             <span class="keyword">friend</span> DataStream&amp; <a class="code" href="structeosio_1_1generic__currency_1_1issue.html#a20dfa160951f3fa52bf2cd934ab13f90">operator &lt;&lt; </a>( DataStream&amp; ds, <span class="keyword">const</span> <a class="code" href="structeosio_1_1generic__currency_1_1account.html">account</a>&amp; t ){</div><div class="line"><a name="l00081"></a><span class="lineno">   81</span>&#160;                <span class="keywordflow">return</span> ds &lt;&lt; t.<a class="code" href="structeosio_1_1generic__currency_1_1account.html#a89518368bbfea762aa94dc2ec394c0a6">symbol</a> &lt;&lt; t.<a class="code" href="structeosio_1_1generic__currency_1_1account.html#a13c6e346ffae80264736c53efdfce0ee">balance</a>;</div><div class="line"><a name="l00082"></a><span class="lineno">   82</span>&#160;             }</div><div class="line"><a name="l00083"></a><span class="lineno">   83</span>&#160;             <span class="keyword">template</span>&lt;<span class="keyword">typename</span> DataStream&gt;</div><div class="line"><a name="l00084"></a><span class="lineno"><a class="line" href="structeosio_1_1generic__currency_1_1account.html#ab37957c0e100e0737411e2a1064ef6c7">   84</a></span>&#160;             <span class="keyword">friend</span> DataStream&amp; <a class="code" href="structeosio_1_1generic__currency_1_1issue.html#a120e7e039c586b4fad05c295a3c796c8">operator &gt;&gt; </a>( DataStream&amp; ds, <a class="code" href="structeosio_1_1generic__currency_1_1account.html">account</a>&amp; t ){</div><div class="line"><a name="l00085"></a><span class="lineno">   85</span>&#160;                <span class="keywordflow">return</span> ds &gt;&gt; t.<a class="code" href="structeosio_1_1generic__currency_1_1account.html#a89518368bbfea762aa94dc2ec394c0a6">symbol</a> &gt;&gt; t.<a class="code" href="structeosio_1_1generic__currency_1_1account.html#a13c6e346ffae80264736c53efdfce0ee">balance</a>;</div><div class="line"><a name="l00086"></a><span class="lineno">   86</span>&#160;             }</div><div class="line"><a name="l00087"></a><span class="lineno">   87</span>&#160;          };</div><div class="line"><a name="l00088"></a><span class="lineno">   88</span>&#160;</div><div class="line"><a name="l00089"></a><span class="lineno"><a class="line" href="structeosio_1_1generic__currency_1_1currency__stats.html">   89</a></span>&#160;          <span class="keyword">struct </span><a class="code" href="structeosio_1_1generic__currency_1_1currency__stats.html">currency_stats</a> {</div><div class="line"><a name="l00090"></a><span class="lineno"><a class="line" href="structeosio_1_1generic__currency_1_1currency__stats.html#a29958d48ab5309e1a4c3b9aa7ac62213">   90</a></span>&#160;             <a class="code" href="group__types.html#gaaa5d1cd013383c889537491c3cfd9aad">uint64_t</a>   symbol = token_type::symbol;</div><div class="line"><a name="l00091"></a><span class="lineno"><a class="line" href="structeosio_1_1generic__currency_1_1currency__stats.html#a93b65e8968371eac0278a4cfae11b343">   91</a></span>&#160;             token_type <a class="code" href="structeosio_1_1generic__currency_1_1currency__stats.html#a93b65e8968371eac0278a4cfae11b343">supply</a>;</div><div class="line"><a name="l00092"></a><span class="lineno">   92</span>&#160;</div><div class="line"><a name="l00093"></a><span class="lineno">   93</span>&#160;             <span class="keyword">template</span>&lt;<span class="keyword">typename</span> DataStream&gt;</div><div class="line"><a name="l00094"></a><span class="lineno"><a class="line" href="structeosio_1_1generic__currency_1_1currency__stats.html#ad369edd94a8ed313448d459341e0251b">   94</a></span>&#160;             <span class="keyword">friend</span> DataStream&amp; <a class="code" href="structeosio_1_1generic__currency_1_1issue.html#a20dfa160951f3fa52bf2cd934ab13f90">operator &lt;&lt; </a>( DataStream&amp; ds, <span class="keyword">const</span> <a class="code" href="structeosio_1_1generic__currency_1_1currency__stats.html">currency_stats</a>&amp; t ){</div><div class="line"><a name="l00095"></a><span class="lineno">   95</span>&#160;                <span class="keywordflow">return</span> ds &lt;&lt; t.<a class="code" href="structeosio_1_1generic__currency_1_1currency__stats.html#a29958d48ab5309e1a4c3b9aa7ac62213">symbol</a> &lt;&lt; t.<a class="code" href="structeosio_1_1generic__currency_1_1currency__stats.html#a93b65e8968371eac0278a4cfae11b343">supply</a>;</div><div class="line"><a name="l00096"></a><span class="lineno">   96</span>&#160;             }</div><div class="line"><a name="l00097"></a><span class="lineno">   97</span>&#160;             <span class="keyword">template</span>&lt;<span class="keyword">typename</span> DataStream&gt;</div><div class="line"><a name="l00098"></a><span class="lineno"><a class="line" href="structeosio_1_1generic__currency_1_1currency__stats.html#a87f1631fc115cffa12136f0b7a73a8c4">   98</a></span>&#160;             <span class="keyword">friend</span> DataStream&amp; <a class="code" href="structeosio_1_1generic__currency_1_1issue.html#a120e7e039c586b4fad05c295a3c796c8">operator &gt;&gt; </a>( DataStream&amp; ds, <a class="code" href="structeosio_1_1generic__currency_1_1currency__stats.html">currency_stats</a>&amp; t ){</div><div class="line"><a name="l00099"></a><span class="lineno">   99</span>&#160;                <span class="keywordflow">return</span> ds &gt;&gt; t.<a class="code" href="structeosio_1_1generic__currency_1_1currency__stats.html#a29958d48ab5309e1a4c3b9aa7ac62213">symbol</a> &gt;&gt; t.<a class="code" href="structeosio_1_1generic__currency_1_1currency__stats.html#a93b65e8968371eac0278a4cfae11b343">supply</a>;</div><div class="line"><a name="l00100"></a><span class="lineno">  100</span>&#160;             }</div><div class="line"><a name="l00101"></a><span class="lineno">  101</span>&#160;          };</div><div class="line"><a name="l00102"></a><span class="lineno">  102</span>&#160;</div><div class="line"><a name="l00107"></a><span class="lineno"><a class="line" href="classeosio_1_1generic__currency.html#adea343e32af49682b5ab6177fb7a6c58">  107</a></span>&#160;          <span class="keyword">typedef</span> <a class="code" href="classeosio_1_1table64.html">table64&lt;code, accounts_table_name, account&gt;</a>      <a class="code" href="classeosio_1_1generic__currency.html#adea343e32af49682b5ab6177fb7a6c58">accounts</a>;</div><div class="line"><a name="l00108"></a><span class="lineno"><a class="line" href="classeosio_1_1generic__currency.html#aed11f3d3ccc7f8be5c0552ba4392b7f1">  108</a></span>&#160;          <span class="keyword">typedef</span> <a class="code" href="classeosio_1_1table64.html">table64&lt;code, stats_table_name, currency_stats&gt;</a>  <a class="code" href="classeosio_1_1generic__currency.html#aed11f3d3ccc7f8be5c0552ba4392b7f1">stats</a>;</div><div class="line"><a name="l00109"></a><span class="lineno">  109</span>&#160;</div><div class="line"><a name="l00110"></a><span class="lineno"><a class="line" href="classeosio_1_1generic__currency.html#a5de588929b2080e247d6e5163193b282">  110</a></span>&#160;          <span class="keyword">static</span> token_type <a class="code" href="classeosio_1_1generic__currency.html#a5de588929b2080e247d6e5163193b282">get_balance</a>( <a class="code" href="group__types.html#ga3b44deb4b3b8d6ebab339d1263692117">account_name</a> owner ) {</div><div class="line"><a name="l00111"></a><span class="lineno">  111</span>&#160;             <span class="keywordflow">return</span> <a class="code" href="classeosio_1_1table64.html#a9dff23caa5b55231ec2afb51dc97b291">accounts::get_or_create</a>( token_type::symbol, owner ).balance;</div><div class="line"><a name="l00112"></a><span class="lineno">  112</span>&#160;          }</div><div class="line"><a name="l00113"></a><span class="lineno">  113</span>&#160;</div><div class="line"><a name="l00114"></a><span class="lineno"><a class="line" href="classeosio_1_1generic__currency.html#a51b194cc27d13d9050b0d1514c921118">  114</a></span>&#160;          <span class="keyword">static</span> <span class="keywordtype">void</span> <a class="code" href="classeosio_1_1generic__currency.html#a51b194cc27d13d9050b0d1514c921118">set_balance</a>( <a class="code" href="group__types.html#ga3b44deb4b3b8d6ebab339d1263692117">account_name</a> owner, token_type balance ) {</div><div class="line"><a name="l00115"></a><span class="lineno">  115</span>&#160;             <a class="code" href="classeosio_1_1table64.html#a44d08e191f96bc50597aee3a085d2938">accounts::set</a>( <a class="code" href="structeosio_1_1generic__currency_1_1account.html">account</a>{token_type::symbol,balance}, owner );</div><div class="line"><a name="l00116"></a><span class="lineno">  116</span>&#160;          }</div><div class="line"><a name="l00117"></a><span class="lineno">  117</span>&#160;</div><div class="line"><a name="l00118"></a><span class="lineno"><a class="line" href="classeosio_1_1generic__currency.html#a9bddd3a5b34e52d8f127973bfc90768d">  118</a></span>&#160;          <span class="keyword">static</span> <span class="keywordtype">void</span> <a class="code" href="classeosio_1_1generic__currency.html#a9bddd3a5b34e52d8f127973bfc90768d">on</a>( <span class="keyword">const</span> <a class="code" href="structeosio_1_1generic__currency_1_1issue.html">issue</a>&amp; act ) {</div><div class="line"><a name="l00119"></a><span class="lineno">  119</span>&#160;             <a class="code" href="group__actioncapi.html#gab1e668e93ac1f94421743ed79edffb26">require_auth</a>( code );</div><div class="line"><a name="l00120"></a><span class="lineno">  120</span>&#160;</div><div class="line"><a name="l00121"></a><span class="lineno">  121</span>&#160;             <span class="keyword">auto</span> s = <a class="code" href="classeosio_1_1table64.html#a9dff23caa5b55231ec2afb51dc97b291">stats::get_or_create</a>(token_type::symbol);</div><div class="line"><a name="l00122"></a><span class="lineno">  122</span>&#160;             s.supply += act.<a class="code" href="structeosio_1_1generic__currency_1_1issue.html#ab63969c82900ca3cab6909262f83828e">quantity</a>;</div><div class="line"><a name="l00123"></a><span class="lineno">  123</span>&#160;             <a class="code" href="classeosio_1_1table64.html#a44d08e191f96bc50597aee3a085d2938">stats::set</a>(s);</div><div class="line"><a name="l00124"></a><span class="lineno">  124</span>&#160;</div><div class="line"><a name="l00125"></a><span class="lineno">  125</span>&#160;             <a class="code" href="classeosio_1_1generic__currency.html#a51b194cc27d13d9050b0d1514c921118">set_balance</a>( code, <a class="code" href="classeosio_1_1generic__currency.html#a5de588929b2080e247d6e5163193b282">get_balance</a>( code ) + act.<a class="code" href="structeosio_1_1generic__currency_1_1issue.html#ab63969c82900ca3cab6909262f83828e">quantity</a> );</div><div class="line"><a name="l00126"></a><span class="lineno">  126</span>&#160;</div><div class="line"><a name="l00127"></a><span class="lineno">  127</span>&#160;             <a class="code" href="classeosio_1_1generic__currency.html#a4b46e79e82a7cb7f26b3ea6058e650a3">inline_transfer</a>( code, act.<a class="code" href="structeosio_1_1generic__currency_1_1issue.html#ad7a382e1cf0662bec97b221280afbff4">to</a>, act.<a class="code" href="structeosio_1_1generic__currency_1_1issue.html#ab63969c82900ca3cab6909262f83828e">quantity</a> ); </div><div class="line"><a name="l00128"></a><span class="lineno">  128</span>&#160;          }</div><div class="line"><a name="l00129"></a><span class="lineno">  129</span>&#160;</div><div class="line"><a name="l00130"></a><span class="lineno">  130</span>&#160;</div><div class="line"><a name="l00131"></a><span class="lineno"><a class="line" href="classeosio_1_1generic__currency.html#a103e4501e8dc86fc3048ba5f04aa7892">  131</a></span>&#160;          <span class="keyword">static</span> <span class="keywordtype">void</span> <a class="code" href="classeosio_1_1generic__currency.html#a103e4501e8dc86fc3048ba5f04aa7892">on</a>( <span class="keyword">const</span> <a class="code" href="structeosio_1_1generic__currency_1_1transfer.html">transfer</a>&amp; act ) {</div><div class="line"><a name="l00132"></a><span class="lineno">  132</span>&#160;             <a class="code" href="group__actioncapi.html#gab1e668e93ac1f94421743ed79edffb26">require_auth</a>( act.<a class="code" href="structeosio_1_1generic__currency_1_1transfer.html#abf091a9eedd3b678e95d0425bf765126">from</a> );</div><div class="line"><a name="l00133"></a><span class="lineno">  133</span>&#160;             <a class="code" href="group__actioncppapi.html#ga8d2d8ca22e484fab7dbfe99cc8564e04">require_recipient</a>(act.<a class="code" href="structeosio_1_1generic__currency_1_1transfer.html#a0c9d02a236a387f2cf1e1385f2f1ba11">to</a>,act.<a class="code" href="structeosio_1_1generic__currency_1_1transfer.html#abf091a9eedd3b678e95d0425bf765126">from</a>);</div><div class="line"><a name="l00134"></a><span class="lineno">  134</span>&#160;</div><div class="line"><a name="l00135"></a><span class="lineno">  135</span>&#160;             <a class="code" href="classeosio_1_1generic__currency.html#a51b194cc27d13d9050b0d1514c921118">set_balance</a>( act.<a class="code" href="structeosio_1_1generic__currency_1_1transfer.html#abf091a9eedd3b678e95d0425bf765126">from</a>, <a class="code" href="classeosio_1_1generic__currency.html#a5de588929b2080e247d6e5163193b282">get_balance</a>( act.<a class="code" href="structeosio_1_1generic__currency_1_1transfer.html#abf091a9eedd3b678e95d0425bf765126">from</a> ) - act.<a class="code" href="structeosio_1_1generic__currency_1_1transfer.html#a3cfaf544c7e318e4a9d6bf1a5c18d44c">quantity</a> );</div><div class="line"><a name="l00136"></a><span class="lineno">  136</span>&#160;             <a class="code" href="classeosio_1_1generic__currency.html#a51b194cc27d13d9050b0d1514c921118">set_balance</a>( act.<a class="code" href="structeosio_1_1generic__currency_1_1transfer.html#a0c9d02a236a387f2cf1e1385f2f1ba11">to</a>, <a class="code" href="classeosio_1_1generic__currency.html#a5de588929b2080e247d6e5163193b282">get_balance</a>( act.<a class="code" href="structeosio_1_1generic__currency_1_1transfer.html#a0c9d02a236a387f2cf1e1385f2f1ba11">to</a> ) + act.<a class="code" href="structeosio_1_1generic__currency_1_1transfer.html#a3cfaf544c7e318e4a9d6bf1a5c18d44c">quantity</a> );</div><div class="line"><a name="l00137"></a><span class="lineno">  137</span>&#160;          }</div><div class="line"><a name="l00138"></a><span class="lineno">  138</span>&#160;</div><div class="line"><a name="l00139"></a><span class="lineno"><a class="line" href="classeosio_1_1generic__currency.html#a4b46e79e82a7cb7f26b3ea6058e650a3">  139</a></span>&#160;          <span class="keyword">static</span> <span class="keywordtype">void</span> <a class="code" href="classeosio_1_1generic__currency.html#a4b46e79e82a7cb7f26b3ea6058e650a3">inline_transfer</a>( <a class="code" href="group__types.html#ga3b44deb4b3b8d6ebab339d1263692117">account_name</a> from, <a class="code" href="group__types.html#ga3b44deb4b3b8d6ebab339d1263692117">account_name</a> <a class="code" href="structeosio_1_1generic__currency_1_1issue.html#ad7a382e1cf0662bec97b221280afbff4">to</a>, token_type <a class="code" href="structeosio_1_1generic__currency_1_1issue.html#ab63969c82900ca3cab6909262f83828e">quantity</a>, </div><div class="line"><a name="l00140"></a><span class="lineno">  140</span>&#160;                                       <span class="keywordtype">string</span> memo = <span class="keywordtype">string</span>() )</div><div class="line"><a name="l00141"></a><span class="lineno">  141</span>&#160;          {</div><div class="line"><a name="l00142"></a><span class="lineno">  142</span>&#160;             <a class="code" href="structeosio_1_1action.html">action</a> act( <a class="code" href="structeosio_1_1permission__level.html">permission_level</a>(code,<a class="code" href="group__types.html#gaf9c1edb0e0da55ec6ba09f32f6839529">N</a>(active)), <a class="code" href="structeosio_1_1generic__currency_1_1transfer__memo.html">transfer_memo</a>( from, to, <a class="code" href="structeosio_1_1asset.html">asset</a>(quantity), <a class="code" href="namespaceeosio.html#af29f4c3b46ef396883a8ba57c534a808">move</a>(memo) ));</div><div class="line"><a name="l00143"></a><span class="lineno">  143</span>&#160;             act.<a class="code" href="structeosio_1_1action.html#a447f36a63208c2d138b7109b3e13e55f">send</a>();</div><div class="line"><a name="l00144"></a><span class="lineno">  144</span>&#160;          }</div><div class="line"><a name="l00145"></a><span class="lineno">  145</span>&#160;</div><div class="line"><a name="l00146"></a><span class="lineno">  146</span>&#160;</div><div class="line"><a name="l00147"></a><span class="lineno"><a class="line" href="classeosio_1_1generic__currency.html#a44be6e4a4fd023c9cdc40dcb17ab18e8">  147</a></span>&#160;         <span class="keyword">static</span> <span class="keywordtype">void</span> <a class="code" href="classeosio_1_1generic__currency.html#a44be6e4a4fd023c9cdc40dcb17ab18e8">apply</a>( <a class="code" href="group__types.html#ga3b44deb4b3b8d6ebab339d1263692117">account_name</a> c, <a class="code" href="group__types.html#gab0390a1836d20bbbb735af2fce1ad3e8">action_name</a> act) {</div><div class="line"><a name="l00148"></a><span class="lineno">  148</span>&#160;            eosio::dispatch&lt;generic_currency, transfer_memo, issue&gt;(c,act);</div><div class="line"><a name="l00149"></a><span class="lineno">  149</span>&#160;         }</div><div class="line"><a name="l00150"></a><span class="lineno">  150</span>&#160;   };</div><div class="line"><a name="l00151"></a><span class="lineno">  151</span>&#160;</div><div class="line"><a name="l00152"></a><span class="lineno">  152</span>&#160;} </div><div class="line"><a name="l00153"></a><span class="lineno">  153</span>&#160;</div><div class="line"><a name="l00154"></a><span class="lineno">  154</span>&#160;</div><div class="line"><a name="l00155"></a><span class="lineno">  155</span>&#160;</div><div class="line"><a name="l00156"></a><span class="lineno">  156</span>&#160;</div><div class="line"><a name="l00157"></a><span class="lineno">  157</span>&#160;<span class="preprocessor">#if 0</span></div><div class="line"><a name="l00158"></a><span class="lineno">  158</span>&#160;<span class="keyword">template</span>&lt;account_name RelayAccount, account_name FirstCurrency, account_name SecondCurrency&gt;</div><div class="line"><a name="l00159"></a><span class="lineno">  159</span>&#160;<span class="keyword">class </span>relay_contract {</div><div class="line"><a name="l00160"></a><span class="lineno">  160</span>&#160;   <span class="keyword">public</span>:</div><div class="line"><a name="l00161"></a><span class="lineno">  161</span>&#160;      <span class="keyword">typedef</span> <a class="code" href="classeosio_1_1generic__currency.html">generic_currency&lt;RelayAccount&gt;</a>   <a class="code" href="namespacebancor.html#aea6f53e9c5f646f2cb55e93fadaf39c6">relay_currency</a>;</div><div class="line"><a name="l00162"></a><span class="lineno">  162</span>&#160;      <span class="keyword">typedef</span> <a class="code" href="classeosio_1_1generic__currency.html">generic_currency&lt;FirstCurrency&gt;</a>  first_currency;</div><div class="line"><a name="l00163"></a><span class="lineno">  163</span>&#160;      <span class="keyword">typedef</span> <a class="code" href="classeosio_1_1generic__currency.html">generic_currency&lt;SecondCurrency&gt;</a> second_currency;</div><div class="line"><a name="l00164"></a><span class="lineno">  164</span>&#160;</div><div class="line"><a name="l00165"></a><span class="lineno">  165</span>&#160;      <span class="keyword">template</span>&lt;<span class="keyword">typename</span> CurrencyType, u<span class="keywordtype">int</span>32_t Weight=500000, u<span class="keywordtype">int</span>32_t Base=1000000&gt; </div><div class="line"><a name="l00166"></a><span class="lineno">  166</span>&#160;      <span class="keyword">struct </span>connector {</div><div class="line"><a name="l00167"></a><span class="lineno">  167</span>&#160;         <span class="keyword">typedef</span> CurrencyType currency_type;</div><div class="line"><a name="l00168"></a><span class="lineno">  168</span>&#160;</div><div class="line"><a name="l00169"></a><span class="lineno">  169</span>&#160;         relay_currency::token_type convert_to_relay( currency_type::token_type in, relay_state&amp; state ) {</div><div class="line"><a name="l00170"></a><span class="lineno">  170</span>&#160;            currency_type::token_type balance = currency_type::get_balance( RelayAccount );</div><div class="line"><a name="l00171"></a><span class="lineno">  171</span>&#160;</div><div class="line"><a name="l00173"></a><span class="lineno">  173</span>&#160;            currency_type::token_type previous_balance = balance - in; </div><div class="line"><a name="l00174"></a><span class="lineno">  174</span>&#160;</div><div class="line"><a name="l00175"></a><span class="lineno">  175</span>&#160;            <span class="keyword">auto</span> init_price = (previous_balance * Base) / (Weight * state.supply);</div><div class="line"><a name="l00176"></a><span class="lineno">  176</span>&#160;            <span class="keyword">auto</span> init_out   = init_price * in;</div><div class="line"><a name="l00177"></a><span class="lineno">  177</span>&#160;</div><div class="line"><a name="l00178"></a><span class="lineno">  178</span>&#160;            <span class="keyword">auto</span> out_price  = (balance*Base) / (Weight * (state.supply+init_out) );</div><div class="line"><a name="l00179"></a><span class="lineno">  179</span>&#160;            <span class="keyword">auto</span> final_out  = out_price * in;</div><div class="line"><a name="l00180"></a><span class="lineno">  180</span>&#160;</div><div class="line"><a name="l00181"></a><span class="lineno">  181</span>&#160;            state.balance += final_out;</div><div class="line"><a name="l00182"></a><span class="lineno">  182</span>&#160;            state.supply  += final_out;</div><div class="line"><a name="l00183"></a><span class="lineno">  183</span>&#160;</div><div class="line"><a name="l00184"></a><span class="lineno">  184</span>&#160;            <span class="keywordflow">return</span> final_out;</div><div class="line"><a name="l00185"></a><span class="lineno">  185</span>&#160;         }</div><div class="line"><a name="l00186"></a><span class="lineno">  186</span>&#160;</div><div class="line"><a name="l00187"></a><span class="lineno">  187</span>&#160;</div><div class="line"><a name="l00188"></a><span class="lineno">  188</span>&#160;         currency_type::token_type convert_from_relay( relay_currency::token_type relay_in, relay_state&amp; state ) {</div><div class="line"><a name="l00189"></a><span class="lineno">  189</span>&#160;            currency_type::token_type  to_balance             = CurrencyType::get_balance( RelayAccount );</div><div class="line"><a name="l00190"></a><span class="lineno">  190</span>&#160;</div><div class="line"><a name="l00191"></a><span class="lineno">  191</span>&#160;            <span class="keyword">auto</span>                      init_price = (to_balance * Base) / (Weight * state.supply);</div><div class="line"><a name="l00192"></a><span class="lineno">  192</span>&#160;            currency_type::token_type init_out   = init_price * in;</div><div class="line"><a name="l00193"></a><span class="lineno">  193</span>&#160;</div><div class="line"><a name="l00194"></a><span class="lineno">  194</span>&#160;            state.supply  -= relay_in;</div><div class="line"><a name="l00195"></a><span class="lineno">  195</span>&#160;            state.balance -= relay_in;</div><div class="line"><a name="l00196"></a><span class="lineno">  196</span>&#160;</div><div class="line"><a name="l00197"></a><span class="lineno">  197</span>&#160;            <span class="keyword">auto</span> out_price  = ((to_balance-init_out) * Base) / ( Weight * (state.supply) )</div><div class="line"><a name="l00198"></a><span class="lineno">  198</span>&#160;</div><div class="line"><a name="l00199"></a><span class="lineno">  199</span>&#160;            <span class="keywordflow">return</span> out_price * relay_in;</div><div class="line"><a name="l00200"></a><span class="lineno">  200</span>&#160;         }</div><div class="line"><a name="l00201"></a><span class="lineno">  201</span>&#160;</div><div class="line"><a name="l00202"></a><span class="lineno">  202</span>&#160;      };</div><div class="line"><a name="l00203"></a><span class="lineno">  203</span>&#160;</div><div class="line"><a name="l00204"></a><span class="lineno">  204</span>&#160;      <span class="keyword">struct </span>relay_state {</div><div class="line"><a name="l00205"></a><span class="lineno">  205</span>&#160;         relay_currency::token_type supply; </div><div class="line"><a name="l00206"></a><span class="lineno">  206</span>&#160;         relay_currency::token_type balance; </div><div class="line"><a name="l00207"></a><span class="lineno">  207</span>&#160;      };</div><div class="line"><a name="l00208"></a><span class="lineno">  208</span>&#160;</div><div class="line"><a name="l00209"></a><span class="lineno">  209</span>&#160;      <span class="keyword">struct </span>relay_args {</div><div class="line"><a name="l00210"></a><span class="lineno">  210</span>&#160;         <a class="code" href="group__types.html#ga3b44deb4b3b8d6ebab339d1263692117">account_name</a> to_currency_type;</div><div class="line"><a name="l00211"></a><span class="lineno">  211</span>&#160;         <a class="code" href="group__types.html#gaaa5d1cd013383c889537491c3cfd9aad">uint64_t</a>     min_return_currency;</div><div class="line"><a name="l00212"></a><span class="lineno">  212</span>&#160;      };</div><div class="line"><a name="l00213"></a><span class="lineno">  213</span>&#160;</div><div class="line"><a name="l00214"></a><span class="lineno">  214</span>&#160;</div><div class="line"><a name="l00219"></a><span class="lineno">  219</span>&#160;      <span class="keyword">static</span> <span class="keywordtype">void</span> on_convert( <span class="keyword">const</span> <span class="keyword">typename</span> relay_currency::transfer&amp; trans, </div><div class="line"><a name="l00220"></a><span class="lineno">  220</span>&#160;                                    <span class="keyword">const</span> relay_args&amp; args, </div><div class="line"><a name="l00221"></a><span class="lineno">  221</span>&#160;                                    relay_state&amp; state ) {</div><div class="line"><a name="l00222"></a><span class="lineno">  222</span>&#160;</div><div class="line"><a name="l00223"></a><span class="lineno">  223</span>&#160;         <span class="keywordflow">if</span>( args.to_currency_type == first_currency ) {</div><div class="line"><a name="l00224"></a><span class="lineno">  224</span>&#160;            <span class="keyword">auto</span> output = first_connector::convert_from_relay( trans.quantity, state );</div><div class="line"><a name="l00225"></a><span class="lineno">  225</span>&#160;            save_and_send( trans.from, state, output, args.min_return );</div><div class="line"><a name="l00226"></a><span class="lineno">  226</span>&#160;         }</div><div class="line"><a name="l00227"></a><span class="lineno">  227</span>&#160;         <span class="keywordflow">else</span> <span class="keywordflow">if</span>( args.to_currency_type == second_currency ) {</div><div class="line"><a name="l00228"></a><span class="lineno">  228</span>&#160;            <span class="keyword">auto</span> output = second_connector::convert_from_relay( trans.quantity, state );</div><div class="line"><a name="l00229"></a><span class="lineno">  229</span>&#160;            save_and_send( trans.from, state, output, args.min_return );</div><div class="line"><a name="l00230"></a><span class="lineno">  230</span>&#160;         } </div><div class="line"><a name="l00231"></a><span class="lineno">  231</span>&#160;         <span class="keywordflow">else</span> {</div><div class="line"><a name="l00232"></a><span class="lineno">  232</span>&#160;            <a class="code" href="group__systemcapi.html#gae2a6ebaf48fe7c69f847ae18f109d09a">assert</a>( <span class="keyword">false</span>, <span class="stringliteral">&quot;invalid to currency&quot;</span> );</div><div class="line"><a name="l00233"></a><span class="lineno">  233</span>&#160;         }</div><div class="line"><a name="l00234"></a><span class="lineno">  234</span>&#160;      }</div><div class="line"><a name="l00235"></a><span class="lineno">  235</span>&#160;</div><div class="line"><a name="l00236"></a><span class="lineno">  236</span>&#160;</div><div class="line"><a name="l00241"></a><span class="lineno">  241</span>&#160;      <span class="keyword">template</span>&lt;<span class="keyword">typename</span> ConnectorType&gt;</div><div class="line"><a name="l00242"></a><span class="lineno">  242</span>&#160;      <span class="keyword">static</span> <span class="keywordtype">void</span> on_convert( <span class="keyword">const</span> <span class="keyword">typename</span> ConnectorType::currency_type::transfer&amp; trans,</div><div class="line"><a name="l00243"></a><span class="lineno">  243</span>&#160;                                    <span class="keyword">const</span> relay_args&amp; args, </div><div class="line"><a name="l00244"></a><span class="lineno">  244</span>&#160;                                    relay_state&amp; state ) </div><div class="line"><a name="l00245"></a><span class="lineno">  245</span>&#160;      {</div><div class="line"><a name="l00247"></a><span class="lineno">  247</span>&#160;         <span class="keyword">auto</span> relay_out = ConnectorType::convert_to_relay( trans.quantity, state );</div><div class="line"><a name="l00248"></a><span class="lineno">  248</span>&#160;</div><div class="line"><a name="l00249"></a><span class="lineno">  249</span>&#160;         <span class="keywordflow">if</span>( args.to_currency_type == relay_currency )</div><div class="line"><a name="l00250"></a><span class="lineno">  250</span>&#160;         {</div><div class="line"><a name="l00251"></a><span class="lineno">  251</span>&#160;            save_and_send( trans.from, state, relay_out, args.min_return );</div><div class="line"><a name="l00252"></a><span class="lineno">  252</span>&#160;         }</div><div class="line"><a name="l00253"></a><span class="lineno">  253</span>&#160;         <span class="keywordflow">else</span> </div><div class="line"><a name="l00254"></a><span class="lineno">  254</span>&#160;         {</div><div class="line"><a name="l00255"></a><span class="lineno">  255</span>&#160;            <span class="keyword">auto</span> output = ConnectorType::convert_from_relay( relay_out, state ); </div><div class="line"><a name="l00256"></a><span class="lineno">  256</span>&#160;            save_and_send( trans.from, state, output, args.min_return );</div><div class="line"><a name="l00257"></a><span class="lineno">  257</span>&#160;         }</div><div class="line"><a name="l00258"></a><span class="lineno">  258</span>&#160;      }</div><div class="line"><a name="l00259"></a><span class="lineno">  259</span>&#160;</div><div class="line"><a name="l00260"></a><span class="lineno">  260</span>&#160;</div><div class="line"><a name="l00265"></a><span class="lineno">  265</span>&#160;      <span class="keyword">template</span>&lt;<span class="keyword">typename</span> CurrencyType&gt;</div><div class="line"><a name="l00266"></a><span class="lineno">  266</span>&#160;      <span class="keyword">static</span> <span class="keywordtype">void</span> start_convert( <span class="keyword">const</span> CurrencyType::transfer&amp; trans ) {</div><div class="line"><a name="l00267"></a><span class="lineno">  267</span>&#160;         <span class="keyword">auto</span> args = unpack&lt;relay_args&gt;( trans.memo );</div><div class="line"><a name="l00268"></a><span class="lineno">  268</span>&#160;         <a class="code" href="group__systemcapi.html#gae2a6ebaf48fe7c69f847ae18f109d09a">assert</a>( args.to_currency_type != trans.quantity.token_type(), <span class="stringliteral">&quot;cannot convert to self&quot;</span> );</div><div class="line"><a name="l00269"></a><span class="lineno">  269</span>&#160;</div><div class="line"><a name="l00270"></a><span class="lineno">  270</span>&#160;         <span class="keyword">auto</span> state = read_relay_state();</div><div class="line"><a name="l00271"></a><span class="lineno">  271</span>&#160;         on_convert( trans, args, state );</div><div class="line"><a name="l00272"></a><span class="lineno">  272</span>&#160;      }</div><div class="line"><a name="l00273"></a><span class="lineno">  273</span>&#160;</div><div class="line"><a name="l00274"></a><span class="lineno">  274</span>&#160;</div><div class="line"><a name="l00283"></a><span class="lineno">  283</span>&#160;      <span class="keyword">static</span> <span class="keywordtype">void</span> <a class="code" href="classeosio_1_1generic__currency.html#a9bddd3a5b34e52d8f127973bfc90768d">on</a>( <span class="keyword">const</span> relay_currency::transfer&amp; trans ) {</div><div class="line"><a name="l00284"></a><span class="lineno">  284</span>&#160;         <a class="code" href="namespaceeosiosystem.html#a8a502c589b78b453338d6b2c5b4f405d">relay_currency::on</a>( trans );</div><div class="line"><a name="l00285"></a><span class="lineno">  285</span>&#160;         <span class="keywordflow">if</span>( trans.to == RelayAccount ) {</div><div class="line"><a name="l00286"></a><span class="lineno">  286</span>&#160;            start_convert( trans );</div><div class="line"><a name="l00287"></a><span class="lineno">  287</span>&#160;         }</div><div class="line"><a name="l00288"></a><span class="lineno">  288</span>&#160;      }</div><div class="line"><a name="l00289"></a><span class="lineno">  289</span>&#160;</div><div class="line"><a name="l00293"></a><span class="lineno">  293</span>&#160;      <span class="keyword">template</span>&lt;<span class="keyword">typename</span> Currency&gt;</div><div class="line"><a name="l00294"></a><span class="lineno">  294</span>&#160;      <span class="keyword">static</span> <span class="keywordtype">void</span> <a class="code" href="classeosio_1_1generic__currency.html#a9bddd3a5b34e52d8f127973bfc90768d">on</a>( <span class="keyword">const</span> Currency::transfer&amp; trans ) {</div><div class="line"><a name="l00295"></a><span class="lineno">  295</span>&#160;         <span class="keywordflow">if</span>( trans.to == RelayAccount ) {</div><div class="line"><a name="l00296"></a><span class="lineno">  296</span>&#160;            start_convert( trans );</div><div class="line"><a name="l00297"></a><span class="lineno">  297</span>&#160;         } <span class="keywordflow">else</span> {</div><div class="line"><a name="l00298"></a><span class="lineno">  298</span>&#160;            <a class="code" href="group__systemcapi.html#gae2a6ebaf48fe7c69f847ae18f109d09a">assert</a>( trans.from == RelayAccount, </div><div class="line"><a name="l00299"></a><span class="lineno">  299</span>&#160;                    <span class="stringliteral">&quot;received unexpected notification of transfer&quot;</span> );</div><div class="line"><a name="l00300"></a><span class="lineno">  300</span>&#160;         }</div><div class="line"><a name="l00301"></a><span class="lineno">  301</span>&#160;      }</div><div class="line"><a name="l00302"></a><span class="lineno">  302</span>&#160;</div><div class="line"><a name="l00303"></a><span class="lineno">  303</span>&#160;      <span class="keyword">static</span> <span class="keywordtype">void</span> <a class="code" href="classeosio_1_1generic__currency.html#a44be6e4a4fd023c9cdc40dcb17ab18e8">apply</a>( <a class="code" href="group__types.html#ga3b44deb4b3b8d6ebab339d1263692117">account_name</a> <a class="code" href="classeosio_1_1generic__currency.html#ad8da6c376cee10ea81135e399ffa031e">code</a>, <a class="code" href="group__types.html#gab0390a1836d20bbbb735af2fce1ad3e8">action_name</a> <a class="code" href="structeosio_1_1action.html">action</a> ) {</div><div class="line"><a name="l00304"></a><span class="lineno">  304</span>&#160;         <span class="keywordflow">if</span>( !dispatch&lt;Currency, transfer_memo, issue&gt;( code, action ) )</div><div class="line"><a name="l00305"></a><span class="lineno">  305</span>&#160;            <a class="code" href="group__systemcapi.html#gae2a6ebaf48fe7c69f847ae18f109d09a">assert</a>( <span class="keyword">false</span>, <span class="stringliteral">&quot;received unexpected action&quot;</span> );</div><div class="line"><a name="l00306"></a><span class="lineno">  306</span>&#160;      }</div><div class="line"><a name="l00307"></a><span class="lineno">  307</span>&#160;};</div><div class="line"><a name="l00308"></a><span class="lineno">  308</span>&#160;</div><div class="line"><a name="l00309"></a><span class="lineno">  309</span>&#160;<span class="preprocessor">#endif</span></div><div class="line"><a name="l00310"></a><span class="lineno">  310</span>&#160;</div><div class="ttc" id="classeosio_1_1generic__currency_html_adea343e32af49682b5ab6177fb7a6c58"><div class="ttname"><a href="classeosio_1_1generic__currency.html#adea343e32af49682b5ab6177fb7a6c58">eosio::generic_currency::accounts</a></div><div class="ttdeci">table64&lt; code, accounts_table_name, account &gt; accounts</div><div class="ttdef"><b>Definition:</b> generic_currency.hpp:107</div></div>
<div class="ttc" id="structeosio_1_1generic__currency_1_1account_html_a89518368bbfea762aa94dc2ec394c0a6"><div class="ttname"><a href="structeosio_1_1generic__currency_1_1account.html#a89518368bbfea762aa94dc2ec394c0a6">eosio::generic_currency::account::symbol</a></div><div class="ttdeci">uint64_t symbol</div><div class="ttdef"><b>Definition:</b> generic_currency.hpp:76</div></div>
<div class="ttc" id="namespaceeosiosystem_html_a8a502c589b78b453338d6b2c5b4f405d"><div class="ttname"><a href="namespaceeosiosystem.html#a8a502c589b78b453338d6b2c5b4f405d">eosiosystem::on</a></div><div class="ttdeci">void on(const eosiosystem::transfer &amp;act)</div><div class="ttdef"><b>Definition:</b> eosio.system.cpp:14</div></div>
<div class="ttc" id="namespaceeosio_html"><div class="ttname"><a href="namespaceeosio.html">eosio</a></div><div class="ttdoc">Used to forward declare raw functions. </div><div class="ttdef"><b>Definition:</b> account.hpp:12</div></div>
<div class="ttc" id="group__types_html_gaf9c1edb0e0da55ec6ba09f32f6839529"><div class="ttname"><a href="group__types.html#gaf9c1edb0e0da55ec6ba09f32f6839529">N</a></div><div class="ttdeci">#define N(X)</div><div class="ttdoc">used to generate a compile time uint64_t from the base32 encoded string interpretation of X ...</div><div class="ttdef"><b>Definition:</b> types.hpp:62</div></div>
<div class="ttc" id="group__systemcapi_html_gae2a6ebaf48fe7c69f847ae18f109d09a"><div class="ttname"><a href="group__systemcapi.html#gae2a6ebaf48fe7c69f847ae18f109d09a">assert</a></div><div class="ttdeci">void assert(uint32_t test, const char *cstr)</div><div class="ttdoc">Aborts processing of this action and unwinds all pending changes. </div></div>
<div class="ttc" id="structeosio_1_1generic__currency_1_1transfer_html_a51e7f73fde4d8fbceda2374531017284"><div class="ttname"><a href="structeosio_1_1generic__currency_1_1transfer.html#a51e7f73fde4d8fbceda2374531017284">eosio::generic_currency::transfer::transfer</a></div><div class="ttdeci">transfer()</div><div class="ttdef"><b>Definition:</b> generic_currency.hpp:35</div></div>
<div class="ttc" id="structeosio_1_1generic__currency_1_1issue_html"><div class="ttname"><a href="structeosio_1_1generic__currency_1_1issue.html">eosio::generic_currency::issue</a></div><div class="ttdef"><b>Definition:</b> generic_currency.hpp:19</div></div>
<div class="ttc" id="structeosio_1_1generic__currency_1_1issue_html_a120e7e039c586b4fad05c295a3c796c8"><div class="ttname"><a href="structeosio_1_1generic__currency_1_1issue.html#a120e7e039c586b4fad05c295a3c796c8">eosio::generic_currency::issue::operator&gt;&gt;</a></div><div class="ttdeci">friend DataStream &amp; operator&gt;&gt;(DataStream &amp;ds, issue &amp;t)</div><div class="ttdef"><b>Definition:</b> generic_currency.hpp:29</div></div>
<div class="ttc" id="table_8hpp_html"><div class="ttname"><a href="table_8hpp.html">table.hpp</a></div></div>
<div class="ttc" id="structeosio_1_1generic__currency_1_1transfer__memo_html_a59639874f17b0aca9bf5451e659839f9"><div class="ttname"><a href="structeosio_1_1generic__currency_1_1transfer__memo.html#a59639874f17b0aca9bf5451e659839f9">eosio::generic_currency::transfer_memo::memo</a></div><div class="ttdeci">string memo</div><div class="ttdef"><b>Definition:</b> generic_currency.hpp:61</div></div>
<div class="ttc" id="group__types_html_ga3b44deb4b3b8d6ebab339d1263692117"><div class="ttname"><a href="group__types.html#ga3b44deb4b3b8d6ebab339d1263692117">account_name</a></div><div class="ttdeci">uint64_t account_name</div><div class="ttdef"><b>Definition:</b> types.h:35</div></div>
<div class="ttc" id="structeosio_1_1generic__currency_1_1issue_html_a20dfa160951f3fa52bf2cd934ab13f90"><div class="ttname"><a href="structeosio_1_1generic__currency_1_1issue.html#a20dfa160951f3fa52bf2cd934ab13f90">eosio::generic_currency::issue::operator&lt;&lt;</a></div><div class="ttdeci">friend DataStream &amp; operator&lt;&lt;(DataStream &amp;ds, const issue &amp;t)</div><div class="ttdef"><b>Definition:</b> generic_currency.hpp:25</div></div>
<div class="ttc" id="group__types_html_gaaa5d1cd013383c889537491c3cfd9aad"><div class="ttname"><a href="group__types.html#gaaa5d1cd013383c889537491c3cfd9aad">uint64_t</a></div><div class="ttdeci">unsigned long long uint64_t</div><div class="ttdef"><b>Definition:</b> types.h:18</div></div>
<div class="ttc" id="token_8hpp_html"><div class="ttname"><a href="token_8hpp.html">token.hpp</a></div><div class="ttdoc">Defines types and ABI for standard token messages and database tables. </div></div>
<div class="ttc" id="dispatcher_8hpp_html"><div class="ttname"><a href="dispatcher_8hpp.html">dispatcher.hpp</a></div></div>
<div class="ttc" id="structeosio_1_1generic__currency_1_1account_html_a13c6e346ffae80264736c53efdfce0ee"><div class="ttname"><a href="structeosio_1_1generic__currency_1_1account.html#a13c6e346ffae80264736c53efdfce0ee">eosio::generic_currency::account::balance</a></div><div class="ttdeci">token_type balance</div><div class="ttdef"><b>Definition:</b> generic_currency.hpp:77</div></div>
<div class="ttc" id="classeosio_1_1generic__currency_html_a4b46e79e82a7cb7f26b3ea6058e650a3"><div class="ttname"><a href="classeosio_1_1generic__currency.html#a4b46e79e82a7cb7f26b3ea6058e650a3">eosio::generic_currency::inline_transfer</a></div><div class="ttdeci">static void inline_transfer(account_name from, account_name to, token_type quantity, string memo=string())</div><div class="ttdef"><b>Definition:</b> generic_currency.hpp:139</div></div>
<div class="ttc" id="structeosio_1_1generic__currency_1_1currency__stats_html_a29958d48ab5309e1a4c3b9aa7ac62213"><div class="ttname"><a href="structeosio_1_1generic__currency_1_1currency__stats.html#a29958d48ab5309e1a4c3b9aa7ac62213">eosio::generic_currency::currency_stats::symbol</a></div><div class="ttdeci">uint64_t symbol</div><div class="ttdef"><b>Definition:</b> generic_currency.hpp:90</div></div>
<div class="ttc" id="structeosio_1_1generic__currency_1_1transfer_html_ac093aeedb8df49abe7f5f5929a101636"><div class="ttname"><a href="structeosio_1_1generic__currency_1_1transfer.html#ac093aeedb8df49abe7f5f5929a101636">eosio::generic_currency::transfer::transfer</a></div><div class="ttdeci">transfer(account_name f, account_name t, token_type q)</div><div class="ttdef"><b>Definition:</b> generic_currency.hpp:36</div></div>
<div class="ttc" id="structeosio_1_1action_html"><div class="ttname"><a href="structeosio_1_1action.html">eosio::action</a></div><div class="ttdef"><b>Definition:</b> action.hpp:100</div></div>
<div class="ttc" id="classeosio_1_1table64_html_a9dff23caa5b55231ec2afb51dc97b291"><div class="ttname"><a href="classeosio_1_1table64.html#a9dff23caa5b55231ec2afb51dc97b291">eosio::table64::get_or_create</a></div><div class="ttdeci">static T get_or_create(uint64_t key, scope_name scope=DefaultScope, const T &amp;def=T())</div><div class="ttdef"><b>Definition:</b> table.hpp:31</div></div>
<div class="ttc" id="classeosio_1_1generic__currency_html_a10520caf18cda7f18adb03ccf7357db9"><div class="ttname"><a href="classeosio_1_1generic__currency.html#a10520caf18cda7f18adb03ccf7357db9">eosio::generic_currency::token_type</a></div><div class="ttdeci">Token token_type</div><div class="ttdef"><b>Definition:</b> generic_currency.hpp:13</div></div>
<div class="ttc" id="structeosio_1_1generic__currency_1_1issue_html_ab63969c82900ca3cab6909262f83828e"><div class="ttname"><a href="structeosio_1_1generic__currency_1_1issue.html#ab63969c82900ca3cab6909262f83828e">eosio::generic_currency::issue::quantity</a></div><div class="ttdeci">asset quantity</div><div class="ttdef"><b>Definition:</b> generic_currency.hpp:22</div></div>
<div class="ttc" id="classeosio_1_1generic__currency_html_aed11f3d3ccc7f8be5c0552ba4392b7f1"><div class="ttname"><a href="classeosio_1_1generic__currency.html#aed11f3d3ccc7f8be5c0552ba4392b7f1">eosio::generic_currency::stats</a></div><div class="ttdeci">table64&lt; code, stats_table_name, currency_stats &gt; stats</div><div class="ttdef"><b>Definition:</b> generic_currency.hpp:108</div></div>
<div class="ttc" id="classeosio_1_1generic__currency_html_af08bb98a1c7d7946844b716a4da6e951"><div class="ttname"><a href="classeosio_1_1generic__currency.html#af08bb98a1c7d7946844b716a4da6e951">eosio::generic_currency::symbol</a></div><div class="ttdeci">static const uint64_t symbol</div><div class="ttdef"><b>Definition:</b> generic_currency.hpp:15</div></div>
<div class="ttc" id="structeosio_1_1generic__currency_1_1transfer__memo_html_acac5d0a48da7db7b040025b86625d1f8"><div class="ttname"><a href="structeosio_1_1generic__currency_1_1transfer__memo.html#acac5d0a48da7db7b040025b86625d1f8">eosio::generic_currency::transfer_memo::transfer_memo</a></div><div class="ttdeci">transfer_memo(account_name f, account_name t, token_type q, string m)</div><div class="ttdef"><b>Definition:</b> generic_currency.hpp:58</div></div>
<div class="ttc" id="structeosio_1_1asset_html_af2958993908e4647d9101b84a0689ae3"><div class="ttname"><a href="structeosio_1_1asset.html#af2958993908e4647d9101b84a0689ae3">eosio::asset::symbol</a></div><div class="ttdeci">symbol_name symbol</div><div class="ttdef"><b>Definition:</b> asset.hpp:28</div></div>
<div class="ttc" id="structeosio_1_1generic__currency_1_1transfer_html"><div class="ttname"><a href="structeosio_1_1generic__currency_1_1transfer.html">eosio::generic_currency::transfer</a></div><div class="ttdef"><b>Definition:</b> generic_currency.hpp:34</div></div>
<div class="ttc" id="classeosio_1_1generic__currency_html_a103e4501e8dc86fc3048ba5f04aa7892"><div class="ttname"><a href="classeosio_1_1generic__currency.html#a103e4501e8dc86fc3048ba5f04aa7892">eosio::generic_currency::on</a></div><div class="ttdeci">static void on(const transfer &amp;act)</div><div class="ttdef"><b>Definition:</b> generic_currency.hpp:131</div></div>
<div class="ttc" id="structeosio_1_1generic__currency_1_1issue_html_ad7a382e1cf0662bec97b221280afbff4"><div class="ttname"><a href="structeosio_1_1generic__currency_1_1issue.html#ad7a382e1cf0662bec97b221280afbff4">eosio::generic_currency::issue::to</a></div><div class="ttdeci">account_name to</div><div class="ttdef"><b>Definition:</b> generic_currency.hpp:21</div></div>
<div class="ttc" id="structeosio_1_1generic__currency_1_1currency__stats_html_a93b65e8968371eac0278a4cfae11b343"><div class="ttname"><a href="structeosio_1_1generic__currency_1_1currency__stats.html#a93b65e8968371eac0278a4cfae11b343">eosio::generic_currency::currency_stats::supply</a></div><div class="ttdeci">token_type supply</div><div class="ttdef"><b>Definition:</b> generic_currency.hpp:91</div></div>
<div class="ttc" id="structeosio_1_1permission__level_html"><div class="ttname"><a href="structeosio_1_1permission__level.html">eosio::permission_level</a></div><div class="ttdef"><b>Definition:</b> action.hpp:77</div></div>
<div class="ttc" id="classeosio_1_1table64_html_a44d08e191f96bc50597aee3a085d2938"><div class="ttname"><a href="classeosio_1_1table64.html#a44d08e191f96bc50597aee3a085d2938">eosio::table64::set</a></div><div class="ttdeci">static void set(const T &amp;value=T(), scope_name scope=DefaultScope)</div><div class="ttdef"><b>Definition:</b> table.hpp:47</div></div>
<div class="ttc" id="classeosio_1_1table64_html"><div class="ttname"><a href="classeosio_1_1table64.html">eosio::table64</a></div><div class="ttdef"><b>Definition:</b> table.hpp:11</div></div>
<div class="ttc" id="asset_8hpp_html"><div class="ttname"><a href="asset_8hpp.html">asset.hpp</a></div></div>
<div class="ttc" id="structeosio_1_1generic__currency_1_1transfer__memo_html"><div class="ttname"><a href="structeosio_1_1generic__currency_1_1transfer__memo.html">eosio::generic_currency::transfer_memo</a></div><div class="ttdef"><b>Definition:</b> generic_currency.hpp:56</div></div>
<div class="ttc" id="classeosio_1_1generic__currency_html"><div class="ttname"><a href="classeosio_1_1generic__currency.html">eosio::generic_currency</a></div><div class="ttdef"><b>Definition:</b> generic_currency.hpp:11</div></div>
<div class="ttc" id="structeosio_1_1generic__currency_1_1transfer_html_abf091a9eedd3b678e95d0425bf765126"><div class="ttname"><a href="structeosio_1_1generic__currency_1_1transfer.html#abf091a9eedd3b678e95d0425bf765126">eosio::generic_currency::transfer::from</a></div><div class="ttdeci">account_name from</div><div class="ttdef"><b>Definition:</b> generic_currency.hpp:38</div></div>
<div class="ttc" id="group__actioncppapi_html_ga8d2d8ca22e484fab7dbfe99cc8564e04"><div class="ttname"><a href="group__actioncppapi.html#ga8d2d8ca22e484fab7dbfe99cc8564e04">eosio::require_recipient</a></div><div class="ttdeci">void require_recipient(account_name name, accounts... remaining_accounts)</div><div class="ttdoc">Verify specified accounts exist in the set of notified accounts. </div><div class="ttdef"><b>Definition:</b> action.hpp:72</div></div>
<div class="ttc" id="group__actioncapi_html_gab1e668e93ac1f94421743ed79edffb26"><div class="ttname"><a href="group__actioncapi.html#gab1e668e93ac1f94421743ed79edffb26">require_auth</a></div><div class="ttdeci">void require_auth(account_name name)</div><div class="ttdoc">Verify specified account exists in the set of provided auths. </div></div>
<div class="ttc" id="structeosio_1_1generic__currency_1_1currency__stats_html"><div class="ttname"><a href="structeosio_1_1generic__currency_1_1currency__stats.html">eosio::generic_currency::currency_stats</a></div><div class="ttdef"><b>Definition:</b> generic_currency.hpp:89</div></div>
<div class="ttc" id="structeosio_1_1asset_html"><div class="ttname"><a href="structeosio_1_1asset.html">eosio::asset</a></div><div class="ttdef"><b>Definition:</b> asset.hpp:26</div></div>
<div class="ttc" id="structeosio_1_1action_html_a447f36a63208c2d138b7109b3e13e55f"><div class="ttname"><a href="structeosio_1_1action.html#a447f36a63208c2d138b7109b3e13e55f">eosio::action::send</a></div><div class="ttdeci">void send() const</div><div class="ttdef"><b>Definition:</b> action.hpp:149</div></div>
<div class="ttc" id="namespacebancor_html_aea6f53e9c5f646f2cb55e93fadaf39c6"><div class="ttname"><a href="namespacebancor.html#aea6f53e9c5f646f2cb55e93fadaf39c6">bancor::relay_currency</a></div><div class="ttdeci">eosio::generic_currency&lt; eosio::token&lt; N(bancor), S(4, RELAY)&gt; &gt; relay_currency</div><div class="ttdef"><b>Definition:</b> bancor.hpp:18</div></div>
<div class="ttc" id="classeosio_1_1generic__currency_html_a51b194cc27d13d9050b0d1514c921118"><div class="ttname"><a href="classeosio_1_1generic__currency.html#a51b194cc27d13d9050b0d1514c921118">eosio::generic_currency::set_balance</a></div><div class="ttdeci">static void set_balance(account_name owner, token_type balance)</div><div class="ttdef"><b>Definition:</b> generic_currency.hpp:114</div></div>
<div class="ttc" id="structeosio_1_1action__meta_html"><div class="ttname"><a href="structeosio_1_1action__meta.html">eosio::action_meta</a></div><div class="ttdef"><b>Definition:</b> action.hpp:156</div></div>
<div class="ttc" id="classeosio_1_1generic__currency_html_ab2ef05598c7040a8302471ecfdf4c495"><div class="ttname"><a href="classeosio_1_1generic__currency.html#ab2ef05598c7040a8302471ecfdf4c495">eosio::generic_currency::accounts_table_name</a></div><div class="ttdeci">static const uint64_t accounts_table_name</div><div class="ttdef"><b>Definition:</b> generic_currency.hpp:16</div></div>
<div class="ttc" id="classeosio_1_1generic__currency_html_a5de588929b2080e247d6e5163193b282"><div class="ttname"><a href="classeosio_1_1generic__currency.html#a5de588929b2080e247d6e5163193b282">eosio::generic_currency::get_balance</a></div><div class="ttdeci">static token_type get_balance(account_name owner)</div><div class="ttdef"><b>Definition:</b> generic_currency.hpp:110</div></div>
<div class="ttc" id="structeosio_1_1generic__currency_1_1account_html"><div class="ttname"><a href="structeosio_1_1generic__currency_1_1account.html">eosio::generic_currency::account</a></div><div class="ttdef"><b>Definition:</b> generic_currency.hpp:75</div></div>
<div class="ttc" id="namespaceeosio_html_af29f4c3b46ef396883a8ba57c534a808"><div class="ttname"><a href="namespaceeosio.html#af29f4c3b46ef396883a8ba57c534a808">eosio::move</a></div><div class="ttdeci">remove_reference&lt; T &gt;::type &amp;&amp; move(T &amp;&amp;arg)</div><div class="ttdef"><b>Definition:</b> utility.hpp:10</div></div>
<div class="ttc" id="structeosio_1_1generic__currency_1_1transfer_html_a0c9d02a236a387f2cf1e1385f2f1ba11"><div class="ttname"><a href="structeosio_1_1generic__currency_1_1transfer.html#a0c9d02a236a387f2cf1e1385f2f1ba11">eosio::generic_currency::transfer::to</a></div><div class="ttdeci">account_name to</div><div class="ttdef"><b>Definition:</b> generic_currency.hpp:39</div></div>
<div class="ttc" id="classeosio_1_1generic__currency_html_af9ff021f61805a1eec118685013c6952"><div class="ttname"><a href="classeosio_1_1generic__currency.html#af9ff021f61805a1eec118685013c6952">eosio::generic_currency::stats_table_name</a></div><div class="ttdeci">static const uint64_t stats_table_name</div><div class="ttdef"><b>Definition:</b> generic_currency.hpp:17</div></div>
<div class="ttc" id="classeosio_1_1generic__currency_html_a44be6e4a4fd023c9cdc40dcb17ab18e8"><div class="ttname"><a href="classeosio_1_1generic__currency.html#a44be6e4a4fd023c9cdc40dcb17ab18e8">eosio::generic_currency::apply</a></div><div class="ttdeci">static void apply(account_name c, action_name act)</div><div class="ttdef"><b>Definition:</b> generic_currency.hpp:147</div></div>
<div class="ttc" id="structeosio_1_1generic__currency_1_1transfer_html_a3cfaf544c7e318e4a9d6bf1a5c18d44c"><div class="ttname"><a href="structeosio_1_1generic__currency_1_1transfer.html#a3cfaf544c7e318e4a9d6bf1a5c18d44c">eosio::generic_currency::transfer::quantity</a></div><div class="ttdeci">asset quantity</div><div class="ttdef"><b>Definition:</b> generic_currency.hpp:40</div></div>
<div class="ttc" id="classeosio_1_1generic__currency_html_a9bddd3a5b34e52d8f127973bfc90768d"><div class="ttname"><a href="classeosio_1_1generic__currency.html#a9bddd3a5b34e52d8f127973bfc90768d">eosio::generic_currency::on</a></div><div class="ttdeci">static void on(const issue &amp;act)</div><div class="ttdef"><b>Definition:</b> generic_currency.hpp:118</div></div>
<div class="ttc" id="group__types_html_gab0390a1836d20bbbb735af2fce1ad3e8"><div class="ttname"><a href="group__types.html#gab0390a1836d20bbbb735af2fce1ad3e8">action_name</a></div><div class="ttdeci">uint64_t action_name</div><div class="ttdef"><b>Definition:</b> types.h:41</div></div>
<div class="ttc" id="classeosio_1_1generic__currency_html_ad8da6c376cee10ea81135e399ffa031e"><div class="ttname"><a href="classeosio_1_1generic__currency.html#ad8da6c376cee10ea81135e399ffa031e">eosio::generic_currency::code</a></div><div class="ttdeci">static const uint64_t code</div><div class="ttdef"><b>Definition:</b> generic_currency.hpp:14</div></div>
<div class="ttc" id="singleton_8hpp_html"><div class="ttname"><a href="singleton_8hpp.html">singleton.hpp</a></div></div>
<div class="ttc" id="structeosio_1_1generic__currency_1_1transfer__memo_html_af3cea2050d53d3955d4d50e4e3750331"><div class="ttname"><a href="structeosio_1_1generic__currency_1_1transfer__memo.html#af3cea2050d53d3955d4d50e4e3750331">eosio::generic_currency::transfer_memo::transfer_memo</a></div><div class="ttdeci">transfer_memo()</div><div class="ttdef"><b>Definition:</b> generic_currency.hpp:57</div></div>
<div class="ttc" id="structeosio_1_1generic__currency_1_1issue_html_ae02349b4ae5d6ef313d0155b264458d7"><div class="ttname"><a href="structeosio_1_1generic__currency_1_1issue.html#ae02349b4ae5d6ef313d0155b264458d7">eosio::generic_currency::issue::meta</a></div><div class="ttdeci">action_meta&lt; code, N(issue)&gt; meta</div><div class="ttdef"><b>Definition:</b> generic_currency.hpp:20</div></div>
</div><!-- fragment --></div><!-- contents -->
<!-- start footer part -->
<hr class="footer"/><address class="footer"><small>
Generated by &#160;<a href="http://www.doxygen.org/index.html">
<img class="footer" src="doxygen.png" alt="doxygen"/>
</a> 1.8.13
</small></address>
</body>
</html>
